package com.example.demo.utils;

import java.io.*;

/**
 * Created by cherryzou on 2018/1/21.
 * @Desc the base class for upload the picture
 */
public class FileUtil {
    public static void uploadFile(byte[] file, String filePath, String fileName) throws Exception {
        File targetFile = new File(filePath);
        if(!targetFile.exists()){
            targetFile.mkdirs();
        }
        FileOutputStream out = new FileOutputStream(filePath+fileName);
        out.write(file);
        out.flush();
        out.close();

    }
}
